<div class="card mb-4">
  <div class="card-header">
    <h5 class="card-title">
      <%= Spree.t(:shipping_categories) %>
    </h5>
  </div>

  <div class="card-body">
    <div class="form-group">
      <% @shipping_categories.each do |category| %>
        <div class="custom-control custom-checkbox mb-2">
          <%= check_box_tag('shipping_method[shipping_category_ids][]', category.id, @shipping_method.shipping_categories.include?(category), id: "shipping_method_categories_#{category.id}", class: 'custom-control-input') %>
          <%= label_tag "shipping_method_categories_#{category.id}", class: 'custom-control-label' do %>
            <%= category.name.gsub('_',  ' ') %>
          <% end %>
        </div>
      <% end %>
      <%= f.error_message_on :shipping_category_id %>
    </div>
  </div>
</div>